<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>
<html>
<head>
<title>商品点击量</title>
<script language="javascript" type="text/javascript" src="${ctx}/script/Date/WdatePicker.js"></script>
<script type="text/javascript" src="${ctx}/script/common.js"></script>
<script language="javascript" src="${ctx}/script/common/jquery.js"></script>
<script language="javascript" src="${ctx}/script/common/jquery.treeview.js"></script>
<script language="javascript" src="${ctx}/script/common/jquery.cookie.js"></script>
<script language="javascript" src="${ctx}/script/common/jquery.dimensions.js"></script>
<script language="javascript" src="${ctx}/script/common/jquery.popup.js"></script>
<script type="text/javascript" src="${ctx}/script/product/catalog.js"></script>
<script type="text/javascript" src="${ctx}/dwr/interface/catalogHelper.js"></script>
<script type='text/javascript' src='${ctx}/dwr/interface/filterService.js'></script>
<script type='text/javascript' src='${ctx}/dwr/interface/productService.js'></script>
<script type='text/javascript' src='${ctx}/dwr/engine.js'></script>
<script type="text/javascript" src="${ctx}/script/common/common.js"></script>
<script type="text/javascript" src="${ctx}/script/product/product.js"></script>

<%@ include file="/pages/safeai/jsp/common/meta.jsp"%>
<link href="${ctx}/css/safeai/together.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
jQuery(document).ready(function(){
	jQuery.noConflict();
	var select=jQuery("#selectSearch option:selected").val();
		if(select==1){
			jQuery("#selector").hide();
			jQuery("#clickProductName").show();
			
		}else if(select==2){
			jQuery("#clickProductName").hide();
			jQuery("#selector").show();
		}
});
	function searchClick(){
		jQuery.noConflict();
		var select=jQuery("#selectSearch option:selected").val();
		if(select==1){
			jQuery("#selector").hide();
			jQuery("#clickProductName").show();
			jQuery("#clickProductName").val("");
			jQuery("#clickProductId").val("");
		}else if(select==2){
			jQuery("#clickProductName").hide();
			jQuery("#selector").show();
			jQuery("#clickProductName").val("");
			jQuery("#clickProductId").val("");
		}
	}
</script>
</head>
<body>
	<form action="${ctx }/product/clickNum.do?method=searchProductClickNumlist" method="post">
	<table align="center" width="600px">
		<tr>
			<th colspan="2" class="td_01" height="25px">商品点击量查询</th>
        </tr>
        <tr>
			<td nowrap class="td_03">
				<select id="selectSearch" onchange="searchClick();">
					<option value="1">商品名模糊查询:</option>
					
					<option value="2" <logic:notEmpty name="clickProductId">selected</logic:notEmpty>>商品精确查找:</option>
				</select>
			</td>
			<td class="td_03"><input style="display: block;" type="text" value="${clickProductName}" id="clickProductName"  name="clickProductName"/>
				<input style="display: none;" type="button" class="btn" id="selector" name="selector" value="选择" onclick="javascript:productSelector('','clickProductId')" />
				<input type="hidden" name="clickProductId" id="clickProductId" value="${clickProductId}"/></td>
         </tr>
         <tr>
			<td class="td_03">起始日期：
			<input class="Wdate" id="startDate" name="startDate" type="text"
							onfocus="WdatePicker()"
							maxdate="#F{$('endDate').value}" value="${startDate}"
							onpicked="$('endDate').onfocus()" readonly="readonly" />
			</td>
			<td class="td_03">结束日期：
			
			<input class="Wdate" id="endDate" name="endDate" type="text"
							onfocus="new WdatePicker()"
							MINDATE="#F{$('startDate').value}" value="${endDate}"
							readonly="readonly" />
			</td>
            </tr>
            <tr>
			<td colspan="2" align="center"><input type="submit" class="btn" value="查询"/></td>
		</tr>
	</table>
</form>
<table align="center" width="600px">
		<tr>
			<th height="25px" class="td_01"> 商品名称</th><th class="td_01" nowrap>点击量</th><th class="td_01">时间</th>
		</tr>
		<logic:present name="list" >
			<logic:iterate id="clickNum" name="list">
				<tr>
					<td class="td_04"> ${clickNum.productName}</td><td class="td_03">${clickNum.sumnum}</td>
					<c:if test="${startDate==null && endDate==null}">
						<td class="td_03" nowrap>最近一周</td>
					</c:if>
					<c:if test="${startDate!=null or endDate!=null}">
						<td class="td_03">${startDate}至${endDate}</td>
					</c:if>
				</tr>
			</logic:iterate>
		</logic:present>
	</table>
</body>
</html>
